// Programming_Scala/src/ch02/string-util-v1-script.scala
// Version 2 of "StringUtil" for Scala v2.8 only.

object StringUtil {
  def joiner(strings: List[String], separator: String = " "): String =
    strings.mkString(separator)
}

import StringUtil._ // Import the joiner methods.

println( joiner( List( "Programming", "Scala" ) ) )
// This uses a named argument, but you really don't get much for it...
println( joiner( strings = List( "Groovy", "already", "has", "this" ) ) )
// Note that, when using named arguments, you don't have to put them in order...
println( joiner( separator = "_", strings = List( "I", "think", "Python", "does", "too" ) ) )
